import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '下单时间',
    align: "center",
    dataIndex: 'createTime'
  },
  {
    title: '保单状态',
    align: "center",
    width:80,
    dataIndex: 'bdState_dictText'
  },
  {
    title: '承保机构',
    align: "center",
    dataIndex: 'instName'
  },
  {
    title: '保函编号',
    align: "center",
    width:250,
    dataIndex: 'baoHanNo'
  },
  {
    title: '付款企业名称',
    align: "center",
    ellipsis:false,
    width:250,
    dataIndex: 'bidderName'
  },
  {
    title: '业务类型',
    align: "center",
    dataIndex: 'sourceType_dictText'
  },
  {
    title: '平台编码',
    align: "center",
    dataIndex: 'platformCode_dictText'
  },
  {
    title: '付款账号',
    align: "center",
    dataIndex: 'payAccountNo'
  },
  {
    title: '打款序列号',
    align: "center",
    dataIndex: 'serialNumber'
  },
  {
    title: '付款帐户开户行',
    align: "center",
    dataIndex: 'payBank'
  },
  {
    title: '付款到账时间',
    align: "center",
    dataIndex: 'payTime'
  },
  {
    title: '付款金额',
    align: "center",
    dataIndex: 'cost'
  },
  {
    title: '支付结果',
    align: "center",
    dataIndex: 'payState_dictText'
  },
  {
    title: '付款匹配银行',
    align: "center",
    dataIndex: 'matchBank'
  },
  {
    title: '付款银行流水编号',
    align: "center",
    dataIndex: 'matchBankSerialNo'
  },

  {
    title: '开函机构',
    align: "center",
    dataIndex: 'instCode'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "付款企业名称",
    field: 'bidderName',
    component: 'JInput',
    colProps: {span: 6},
  },
  {
    label: "付款帐户名称",
    field: 'payAccountName',
    component: 'JInput',
    colProps: {span: 6},
  },
  {
    label: "付款帐户开户行",
    field: 'payBank',
    component: 'JInput',
    colProps: {span: 6},
  },
  {
    label: "付款金额",
    field: "cost",
    component: 'JRangeNumber',
    colProps: {span: 6},
  },
  {
    label: "支付结果",
    field: 'payState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "XDZFZT"
    },
    colProps: {span: 6},
  },
  {
    label: "保单状态",
    field: 'bdState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "XDBDZT"
    },
    colProps: {span: 6},
  },
  {
    label: "平台编码",
    field: 'platformCode',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "JYPTBM"
    },
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '业务流水号',
    field: 'applyNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入业务流水号!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '付款企业名称',
    field: 'bidderName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款企业名称!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '平台编码',
    field: 'platformCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入平台编码!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '打款序列号',
    field: 'serialNumber',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
        { required: true, message: '打款序列号!'},
      ];
    },
    dynamicDisabled: true
  },
  {
    label: '付款帐户名称',
    field: 'payAccountName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款帐户名称!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '付款帐户开户行',
    field: 'payBank',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款帐户开户行!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '付款到账时间',
    field: 'payTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款到账时间!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '付款金额',
    field: 'cost',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款金额!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '支付结果',
    field: 'payState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "XDZFZT"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入支付结果!'},
             ];
    },
  },
  {
    label: '付款匹配银行',
    field: 'matchBank',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款匹配银行!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '付款银行流水编号',
    field: 'matchBankSerialNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款银行流水编号!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '保单状态',
    field: 'bdState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "XDBDZT"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入保单状态!'},
             ];
    },
  },
  {
    label: '承保机构',
    field: 'instName',
    component: 'Input',
  },
  {
    label: '保函编号',
    field: 'baoHanNo',
    component: 'Input',
    width:250,
  },
  {
    label: '开函机构',
    field: 'instCode',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
